package com.lagou.servlet;

import com.lagou.bean.HttpRequest;
import com.lagou.bean.HttpResponse;

public abstract class HttpServlet implements Servlet {

    public abstract void doGet(HttpRequest request,HttpResponse response);

    public abstract void doPost(HttpRequest request, HttpResponse response);

    @Override
    public void service(HttpRequest request, HttpResponse response) throws Exception {
        if("GET".equalsIgnoreCase(request.getMethod())) {
            doGet(request,response);
        }else{
            doPost(request,response);
        }
    }
}
